A race condition can occur where a notification banner gets stuck on screen
and never disappears.
This happens when a new notification needs to be shown while an old one
is in the middle of its hiding animation. The process to show the new
notification calls `remove_all_transitions()`, which forcefully stops
the hiding animation of the old one.
The cleanup logic, which destroys the old banner actor, was located in
the `onComplete` handler of the animation. Since the animation was
interrupted and not completed, this handler was never called, leaving a
"zombie" banner on screen.
To fix this, the call to the cleanup function is moved from the
`onComplete` handler to an `onStopped` handler. This handler is
guaranteed to be called whenever an animation stops, regardless of
whether it finished successfully or was interrupted. This ensures the
banner is always cleaned up correctly.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6006
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3861>
y: -this._bannerBin.height,
duration,
mode: Clutter.AnimationMode.EASE_OUT_BACK,
- onComplete: () => {
+ onStopped: () => {
this._notificationState = State.HIDDEN;
this._hideNotificationCompleted();
this._updateState();